<template>
  <el-form :model="postForm" ref="postFormRef" :rules="postRules" label-width="180px" size="default"
    label-position="right">
    <!--    <h3 style="text-align: center;">二、从业人员</h3>-->
    <el-row :gutter="20" type="flex" style="flex-wrap: wrap;margin: 20px;">
      <el-col style="margin-bottom: 15px;" :span="23">
        <span style="font-size: 18px;font-weight: bold;line-height: 36px;">单位从业人员情况</span>
      </el-col>
      <el-col :span="12" style="margin-bottom: 15px;">
        <el-form-item prop="responsiblePeopleNum" label="负责人数">
          <el-input type="number" v-model="postForm.responsiblePeopleNum" placeholder="请输入">
          </el-input>
        </el-form-item>
      </el-col>
      <el-col :span="12" style="margin-bottom: 15px;">
        <el-form-item prop="responsiblePeopleWomanNum" label="女性负责人数">
          <el-input type="number" v-model="postForm.responsiblePeopleWomanNum" placeholder="请输入">
          </el-input>
        </el-form-item>

      </el-col>
      <el-col :span="12" style="margin-bottom: 15px;">
        <el-form-item prop="responsiblePeopleNpcNum" label="人大代表人数">
          <el-input type="number" v-model="postForm.responsiblePeopleNpcNum" placeholder="请输入">
          </el-input>
        </el-form-item>

      </el-col>
      <el-col :span="12" style="margin-bottom: 15px;">
        <el-form-item prop="responsiblePeopleCppccNum" label="政协委员人数">
          <el-input type="number" v-model="postForm.responsiblePeopleCppccNum" placeholder="请输入">
          </el-input>
        </el-form-item>

      </el-col>
      <el-col :span="12" style="margin-bottom: 15px;">
        <el-form-item prop="yearlyLaidOffEmploymentNum" label="本年度安排下岗人员就业人数">
          <el-input type="number" v-model="postForm.yearlyLaidOffEmploymentNum" placeholder="请输入">
          </el-input>
        </el-form-item>

      </el-col>
      <el-col :span="12" style="margin-bottom: 15px;">
        <el-form-item prop="collegeGraduatesNum" label="本年度安排大学（ 含中高职）毕业生就业人数">
          <el-input type="number" v-model="postForm.collegeGraduatesNum" placeholder="请输入">
          </el-input>
        </el-form-item>
      </el-col>
      <el-col :span="12" style="margin-bottom: 15px;">
        <el-form-item prop="signFullTimeNum" label="专职工作人员签订聘用合同人数">
          <el-input type="number" v-model="postForm.signFullTimeNum" placeholder="请输入"></el-input>
        </el-form-item>

      </el-col>
      <el-col :span="12" style="margin-bottom: 15px;">
        <el-form-item prop="insureFullTimeNum" label="专职工作人员参加社会保险人数">
          <el-input type="number" v-model="postForm.insureFullTimeNum" placeholder="请输入"></el-input>
        </el-form-item>

      </el-col>
      <el-col :span="12" style="margin-bottom: 15px;">
        <el-form-item prop="unemploymentInsuranceNum" label="失业保险人数">
          <el-input type="number" v-model="postForm.unemploymentInsuranceNum" placeholder="请输入"></el-input>
        </el-form-item>
      </el-col>
      <el-col :span="12" style="margin-bottom: 15px;">
        <el-form-item prop="endowmentInsuranceNum" label="养老保险人数">
          <el-input type="number" v-model="postForm.endowmentInsuranceNum" placeholder="请输入"></el-input>
        </el-form-item>

      </el-col>
      <el-col :span="12" style="margin-bottom: 15px;">
        <el-form-item prop="medicalInsuranceNum" label="医疗保险人数">
          <el-input type="number" v-model="postForm.medicalInsuranceNum" placeholder="请输入"></el-input>
        </el-form-item>

      </el-col>
      <el-col :span="12" style="margin-bottom: 15px;">
        <el-form-item prop="industrialInjuryInsuranceNum" label="工伤保险人数">
          <el-input type="number" v-model="postForm.industrialInjuryInsuranceNum" placeholder="请输入"></el-input>
        </el-form-item>

      </el-col>
      <el-col :span="12" style="margin-bottom: 15px;">
        <el-form-item prop="maternityInjuryInsuranceNum" label="生育保险人数">
          <el-input type="number" v-model="postForm.maternityInjuryInsuranceNum" placeholder="请输入"></el-input>
        </el-form-item>

      </el-col>
      <el-col :span="12" style="margin-bottom: 15px;">
        <el-form-item prop="accumulationFundNum" label="住房公积金人数">
          <el-input type="number" v-model="postForm.accumulationFundNum" placeholder="请输入"></el-input>
        </el-form-item>
      </el-col>
      <el-col style="margin-bottom: 15px;" :span="23">
        <span style="font-size: 18px;font-weight: bold;line-height: 36px;">全体工作人员</span>
      </el-col>
      <el-col :span="12" style="margin-bottom: 15px;">
        <el-form-item prop="staffCount" label="总人数">
          <el-input type="number" v-model="postForm.staffCount" placeholder="请输入"></el-input>
        </el-form-item>

      </el-col>
      <el-col :span="12" style="margin-bottom: 15px;">
        <el-form-item prop="partyMemberCount" label="中共党员">
          <el-input type="number" v-model="postForm.partyMemberCount" placeholder="请输入"></el-input>
        </el-form-item>

      </el-col>
      <el-col :span="12" style="margin-bottom: 15px;">
        <el-form-item prop="volunteerCount" label="志愿者人数">
          <el-input type="number" v-model="postForm.volunteerCount" placeholder="请输入"></el-input>
        </el-form-item>

      </el-col>
      <el-col :span="12" style="margin-bottom: 15px;">
        <el-form-item prop="volunteerTimeCount" label="累计志愿时间（小时）">
          <el-input type="number" v-model="postForm.volunteerTimeCount" placeholder="请输入"></el-input>
        </el-form-item>

      </el-col>
      <el-col :span="12" style="margin-bottom: 15px;">
        <el-form-item prop="staffWomanCount" label="其中:女性人数">
          <el-input type="number" v-model="postForm.staffWomanCount" placeholder="请输入"></el-input>
        </el-form-item>

      </el-col>
      <el-col :span="12" style="margin-bottom: 15px;">
        <el-form-item prop="collegeDiplomaCount" label="大学专科人数">
          <el-input type="number" v-model="postForm.collegeDiplomaCount" placeholder="请输入"></el-input>
        </el-form-item>

      </el-col>
      <el-col :span="12" style="margin-bottom: 15px;">
        <el-form-item prop="undergraduateDegreeCount" label="大学本科及以上人数">
          <el-input type="number" v-model="postForm.undergraduateDegreeCount" placeholder="请输入"></el-input>
        </el-form-item>

      </el-col>
      <el-col :span="12" style="margin-bottom: 15px;">
        <el-form-item prop="assistantSocialWorkerCount" label="助理社会工作师人数">
          <el-input type="number" v-model="postForm.assistantSocialWorkerCount" placeholder="请输入"></el-input>
        </el-form-item>

      </el-col>
      <el-col :span="12" style="margin-bottom: 15px;">
        <el-form-item prop="socialWorkerCount" label="社会工作师人数">
          <el-input type="number" v-model="postForm.socialWorkerCount" placeholder="请输入"></el-input>
        </el-form-item>

      </el-col>
      <el-col style="margin-bottom: 15px;" :span="23">
        <span style="font-size: 18px;font-weight: bold;line-height: 36px;">专职工作人员</span>
      </el-col>
      <el-col :span="12" style="margin-bottom: 15px;">
        <el-form-item prop="fullTimeCount" label="总人数">
          <el-input type="number" v-model="postForm.fullTimeCount" placeholder="请输入"></el-input>
        </el-form-item>
      </el-col>
      <el-col :span="12" style="margin-bottom: 15px;">
        <el-form-item prop="fullTimePartyMemberCount" label="中共党员">
          <el-input type="number" v-model="postForm.fullTimePartyMemberCount" placeholder="请输入"></el-input>
        </el-form-item>
      </el-col>
      <el-col :span="12" style="margin-bottom: 15px;">
        <el-form-item prop="fullTimeVolunteerCount" label="志愿者人数">
          <el-input type="number" v-model="postForm.fullTimeVolunteerCount" placeholder="请输入"></el-input>
        </el-form-item>

      </el-col>
      <el-col :span="12" style="margin-bottom: 15px;">
        <el-form-item prop="fullTimeVolunteerTimeCount" label="累计志愿时间（小时）">
          <el-input type="number" v-model="postForm.fullTimeVolunteerTimeCount" placeholder="请输入"></el-input>
        </el-form-item>

      </el-col>
      <el-col :span="12" style="margin-bottom: 15px;">
        <el-form-item prop="fullTimeWomanCount" label="其中:女性人数">
          <el-input type="number" v-model="postForm.fullTimeWomanCount" placeholder="请输入"></el-input>
        </el-form-item>

      </el-col>
      <el-col :span="12" style="margin-bottom: 15px;">
        <el-form-item prop="fullTimeCollegeDiplomaCount" label="大学专科人数">
          <el-input type="number" v-model="postForm.fullTimeCollegeDiplomaCount" placeholder="请输入"></el-input>
        </el-form-item>

      </el-col>
      <el-col :span="12" style="margin-bottom: 15px;">
        <el-form-item prop="fullTimeUndergraduateDegreeCount" label="大学本科及以上人数">
          <el-input type="number" v-model="postForm.fullTimeUndergraduateDegreeCount" placeholder="请输入"></el-input>
        </el-form-item>

      </el-col>
      <el-col :span="12" style="margin-bottom: 15px;">
        <el-form-item prop="fullTimeAssistantSocialWorkerCount" label="助理社会工作师人数">
          <el-input type="number" v-model="postForm.fullTimeAssistantSocialWorkerCount" placeholder="请输入"></el-input>
        </el-form-item>

      </el-col>
      <el-col :span="12" style="margin-bottom: 15px;">
        <el-form-item prop="fullTimeSocialWorkerCount" label="社会工作师人数">
          <el-input type="number" v-model="postForm.fullTimeSocialWorkerCount" placeholder="请输入"></el-input>
        </el-form-item>

      </el-col>
      <el-col style="margin-bottom: 15px;" :span="23">
        <span style="font-size: 18px;font-weight: bold;line-height: 36px;">全体工作人员-其他信息</span>
      </el-col>
      <el-col :span="12" style="margin-bottom: 15px;">
        <el-form-item prop="ageHirtyFiveCount" label="35岁及以下人数">
          <el-input type="number" v-model="postForm.ageHirtyFiveCount" placeholder="请输入"></el-input>
        </el-form-item>

      </el-col>
      <el-col :span="12" style="margin-bottom: 15px;">
        <el-form-item prop="ageHirtySixCount" label="36岁至45岁人数">
          <el-input type="number" v-model="postForm.ageHirtySixCount" placeholder="请输入"></el-input>
        </el-form-item>

      </el-col>
      <el-col :span="12" style="margin-bottom: 15px;">
        <el-form-item prop="ageFortySixCount" label="46岁至55岁人数">
          <el-input type="number" v-model="postForm.ageFortySixCount" placeholder="请输入"></el-input>
        </el-form-item>

      </el-col>
      <el-col :span="12" style="margin-bottom: 15px;">
        <el-form-item prop="ageFiftySixCount" label="56岁以上人数">
          <el-input type="number" v-model="postForm.ageFiftySixCount" placeholder="请输入"></el-input>
        </el-form-item>

      </el-col>
      <el-col :span="12" style="margin-bottom: 15px;">
        <el-form-item prop="avgSalary" label="平均薪酬">
          <el-input type="number" v-model="postForm.avgSalary" placeholder="请输入"></el-input>
        </el-form-item>

      </el-col>
      <el-col :span="12" style="margin-bottom: 15px;">
        <el-form-item prop="minSalary" label="最低薪酬">
          <el-input type="number" v-model="postForm.minSalary" placeholder="请输入"></el-input>
        </el-form-item>

      </el-col>
      <el-col :span="12" style="margin-bottom: 15px;">
        <el-form-item prop="maxSalary" label="最高薪酬">
          <el-input type="number" v-model="postForm.maxSalary" placeholder="请输入"></el-input>
        </el-form-item>

      </el-col>
      <el-col style="margin-bottom: 15px;" :span="23">
        <span style="font-size: 18px;font-weight: bold;line-height: 36px;">专职工作人员-其他信息</span>
      </el-col>
      <el-col :span="12" style="margin-bottom: 15px;">
        <el-form-item prop="fullTimeAgeHirtyFiveCount" label="35岁及以下人数">
          <el-input type="number" v-model="postForm.fullTimeAgeHirtyFiveCount" placeholder="请输入"></el-input>
        </el-form-item>

      </el-col>
      <el-col :span="12" style="margin-bottom: 15px;">
        <el-form-item prop="fullTimeAgeHirtySixCount" label="36岁至45岁人数">
          <el-input type="number" v-model="postForm.fullTimeAgeHirtySixCount" placeholder="请输入"></el-input>
        </el-form-item>

      </el-col>
      <el-col :span="12" style="margin-bottom: 15px;">
        <el-form-item prop="fullTimeAgeFortySixCount" label="46岁至55岁人数">
          <el-input type="number" v-model="postForm.fullTimeAgeFortySixCount" placeholder="请输入"></el-input>
        </el-form-item>

      </el-col>
      <el-col :span="12" style="margin-bottom: 15px;">
        <el-form-item prop="fullTimeAgeFiftySixCount" label="56岁以上人数">
          <el-input type="number" v-model="postForm.fullTimeAgeFiftySixCount" placeholder="请输入"></el-input>
        </el-form-item>

      </el-col>
      <el-col :span="12" style="margin-bottom: 15px;">
        <el-form-item prop="fullTimeAvgSalary" label="平均薪酬">
          <el-input type="number" v-model="postForm.fullTimeAvgSalary" placeholder="请输入"></el-input>
        </el-form-item>

      </el-col>
      <el-col :span="12" style="margin-bottom: 15px;">
        <el-form-item prop="fullTimeMinSalary" label="最低薪酬">
          <el-input type="number" v-model="postForm.fullTimeMinSalary" placeholder="请输入"></el-input>
        </el-form-item>

      </el-col>
      <el-col :span="12" style="margin-bottom: 15px;">
        <el-form-item prop="fullTimeMaxSalary" label="最高薪酬">
          <el-input type="number" v-model="postForm.fullTimeMaxSalary" placeholder="请输入"></el-input>
        </el-form-item>
      </el-col>
      <el-col style="margin-bottom: 15px;" :span="16">
        <span style="font-size: 18px;font-weight: bold;line-height: 36px;">获奖情况</span>
      </el-col>
      <!--      v-if="awardindex == 0"-->
<!--      <el-col :span="8" style="text-align: right;">-->
<!--        <el-button type="primary" @click="listAwardAdd()">增加</el-button>-->
<!--      </el-col>-->
      <el-col :span="24">
        <el-row v-for="(award, awardindex) in listAward" style="margin-top: 10px;">
          <el-col :span="10">
            名称：
            <el-input v-model="award.title" placeholder="请输入获奖名称" style="width: 70%;"></el-input>
          </el-col>
          <el-col :span="7">
            级别：
            <el-select clearable v-model="award.level" placeholder="请选择" style="width: 60%;">
              <el-option v-for="dict in rewardLevelOptions" :key="dict.id" :label="dict.name" :value="dict.id" />
            </el-select>
          </el-col>
          <el-col :span="7">
            时间：
            <el-date-picker v-model="award.getTime" style="width: 60%;" value-format="YYYY-MM-DD" type="date"
              placeholder="请选择获奖表彰时间">
            </el-date-picker>
          </el-col>
<!--          <el-col :span="2">-->
<!--            <el-button type="danger" @click="listAwardDelete(awardindex)">删除</el-button>-->
<!--          </el-col>-->
<!--          <el-col :span="2" v-if="!award.id">-->
<!--            <el-button @click="saveAward()">保存</el-button>-->
<!--          </el-col>-->
        </el-row>
      </el-col>
    </el-row>
  </el-form>
</template>
<script>

import { getDictByCode, getTableInfoByPage, mfSavePractitioners } from '@/views/yearCheck/ykb/mf/mf'
import { addAward, getAwardList } from '@/views/yearCheck/ykb/otherApi'

export default {
  data() {
    return {
      year: undefined,
      // listAwards: [{ awardName: '', awardlevel: '' }],
      award: { awardName: '', awardlevel: '' },
      rewardLevelOptions: undefined,
      postForm: {
        // responsiblePeopleNum:'1',//负责人数
        // responsiblePeopleWomanNum:'2',//负责人女性人数
        // responsiblePeopleNpcNum:'3',//负责人人大代表人数
        // responsiblePeopleCppccNum:'4',//负责人政协委员人数
        // yearlyLaidOffEmploymentNum:'5',//年度安排下岗人员就业人数
        // collegeGraduatesNum:'46',//本年度安排大学（ 含中高职）毕业生就业数
        // signFullTimeNum:'6',//专职工作人员签订聘用合同人数
        // insureFullTimeNum:'7',//专职工作人员参加社会保险人数
        // unemploymentInsuranceNum:'8',//失业保险人数
        // endowmentInsuranceNum:'9',//养老保险人数
        // medicalInsuranceNum:'10',//医疗保险人数
        // industrialInjuryInsuranceNum:'11',//工伤保险人数
        // maternityInjuryInsuranceNum:'12',//生育保险人数
        // accumulationFundNum:'13',//公积金人数
        // staffCount:'14',//工作人员总人数
        // partyMemberCount:'15',//党员总人数
        // volunteerCount:'16',//志愿者总人数
        // volunteerTimeCount:'17',//累计志愿时间
        // staffWomanCount:'18',//工作人员女性总人数
        // collegeDiplomaCount:'19',//大学专科总人数
        // undergraduateDegreeCount:'20',//大学本科及以上总人数
        // assistantSocialWorkerCount:'21',//助理社会工作师总人数
        // socialWorkerCount:'22',//社会工作师总人数
        // fullTimeCount:'23',//专职工作人员总人数
        // fullTimePartyMemberCount:'24',//专职党员总人数
        // fullTimeVolunteerCount:'24',//专职志愿者总人数
        // fullTimeVolunteerTimeCount:'26',//专职累计志愿时间
        // fullTimeWomanCount:'27',//专职工作人员女性总人数
        // fullTimeCollegeDiplomaCount:'28',//专职大学专科总人数
        // fullTimeUndergraduateDegreeCount:'29',//专职大学本科及以上总人数
        // fullTimeAssistantSocialWorkerCount:'30',//专职助理社会工作师总人数
        // fullTimeSocialWorkerCount:'31',//专职社会工作师总人数
        // ageHirtyFiveCount:'32',//35岁及以下总人数
        // ageHirtySixCount:'33',//36岁至45岁总人数
        // ageFortySixCount:'34',//46岁至55岁总人数
        // ageFiftySixCount:'35',//56岁及以上总人数
        // avgSalary:'36',//平均薪资
        // minSalary:'37',//最低薪资
        // maxSalary:'38',//最高薪资
        // fullTimeAgeHirtyFiveCount:'39',//专职35岁及以下总人数
        // fullTimeAgeHirtySixCount:'40',//专职36岁至45岁总人数
        // fullTimeAgeFortySixCount:'41',//专职46岁至55岁总人数
        // fullTimeAgeFiftySixCount:'42',//专职56岁及以上总人数
        // fullTimeAvgSalary:'43',//专职平均薪资
        // fullTimeMinSalary:'44',//专职最低薪资
        // fullTimeMaxSalary:'45',//专职最高薪资
        // yearlyAwards:'获奖情况',//年度单位获奖情况
        // creditCode:localStorage.getItem("creditCode"),//统一社会信用代码
        // examineYear:localStorage.getItem("examineYear"),//申报年度
        // fullTimeAccountingCount:'',//专职财会人数
        // fullTimeAccountingQualificationCount:'',//专职财会从业资格人数
        // organizationBaseId:'1',//社团组织id
      },
      postRules: {
        yearlyLaidOffEmploymentNum: [{ required: true, message: '请完善', trigger: 'blur' }],
        responsiblePeopleNum: [{ required: true, message: '请完善', trigger: 'blur' }],
        collegeGraduatesNum: [{ required: true, message: '请完善', trigger: 'blur' }],
        signFullTimeNum: [{ required: true, message: '请完善', trigger: 'blur' }],
        responsiblePeopleWomanNum: [{ required: true, message: '请完善', trigger: 'blur' }],
        responsiblePeopleNpcNum: [{ required: true, message: '请完善', trigger: 'blur' }],
        responsiblePeopleCppccNum: [{ required: true, message: '请完善', trigger: 'blur' }],
        insureFullTimeNum: [{ required: true, message: '请完善', trigger: 'blur' }],
        unemploymentInsuranceNum: [{ required: true, message: '请完善', trigger: 'blur' }],
        endowmentInsuranceNum: [{ required: true, message: '请完善', trigger: 'blur' }],
        medicalInsuranceNum: [{ required: true, message: '请完善', trigger: 'blur' }],
        industrialInjuryInsuranceNum: [{ required: true, message: '请完善', trigger: 'blur' }],
        maternityInjuryInsuranceNum: [{ required: true, message: '请完善', trigger: 'blur' }],
        accumulationFundNum: [{ required: true, message: '请完善', trigger: 'blur' }],
        staffCount: [{ required: true, message: '请完善', trigger: 'blur' }],
        partyMemberCount: [{ required: true, message: '请完善', trigger: 'blur' }],
        volunteerCount: [{ required: true, message: '请完善', trigger: 'blur' }],
        volunteerTimeCount: [{ required: true, message: '请完善', trigger: 'blur' }],
        staffWomanCount: [{ required: true, message: '请完善', trigger: 'blur' }],
        collegeDiplomaCount: [{ required: true, message: '请完善', trigger: 'blur' }],
        undergraduateDegreeCount: [{ required: true, message: '请完善', trigger: 'blur' }],
        assistantSocialWorkerCount: [{ required: true, message: '请完善', trigger: 'blur' }],
        socialWorkerCount: [{ required: true, message: '请完善', trigger: 'blur' }],
        fullTimeCount: [{ required: true, message: '请完善', trigger: 'blur' }],
        fullTimePartyMemberCount: [{ required: true, message: '请完善', trigger: 'blur' }],
        fullTimeVolunteerCount: [{ required: true, message: '请完善', trigger: 'blur' }],
        fullTimeVolunteerTimeCount: [{ required: true, message: '请完善', trigger: 'blur' }],
        fullTimeWomanCount: [{ required: true, message: '请完善', trigger: 'blur' }],
        fullTimeCollegeDiplomaCount: [{ required: true, message: '请完善', trigger: 'blur' }],
        fullTimeUndergraduateDegreeCount: [{ required: true, message: '请完善', trigger: 'blur' }],
        fullTimeAssistantSocialWorkerCount: [{ required: true, message: '请完善', trigger: 'blur' }],
        fullTimeSocialWorkerCount: [{ required: true, message: '请完善', trigger: 'blur' }],
        ageHirtyFiveCount: [{ required: true, message: '请完善', trigger: 'blur' }],
        ageHirtySixCount: [{ required: true, message: '请完善', trigger: 'blur' }],
        ageFortySixCount: [{ required: true, message: '请完善', trigger: 'blur' }],
        ageFiftySixCount: [{ required: true, message: '请完善', trigger: 'blur' }],
        avgSalary: [{ required: true, message: '请完善', trigger: 'blur' }],
        minSalary: [{ required: true, message: '请完善', trigger: 'blur' }],
        maxSalary: [{ required: true, message: '请完善', trigger: 'blur' }],
        fullTimeAgeHirtyFiveCount: [{ required: true, message: '请完善', trigger: 'blur' }],
        fullTimeAgeHirtySixCount: [{ required: true, message: '请完善', trigger: 'blur' }],
        fullTimeAgeFortySixCount: [{ required: true, message: '请完善', trigger: 'blur' }],
        fullTimeAgeFiftySixCount: [{ required: true, message: '请完善', trigger: 'blur' }],
        fullTimeAvgSalary: [{ required: true, message: '请完善', trigger: 'blur' }],
        fullTimeMinSalary: [{ required: true, message: '请完善', trigger: 'blur' }],
        fullTimeMaxSalary: [{ required: true, message: '请完善', trigger: 'blur' }],
        fullTimeAccountingCount: [{ required: true, message: '请完善', trigger: 'blur' }],
        fullTimeAccountingQualificationCount: [{ required: true, message: '请完善', trigger: 'blur' }]
      },
      listAward: [],
      awardForm: {
        title: undefined,
        content: undefined,
        getTime: undefined,
        id: undefined,
        imgUrl: undefined,
        level: undefined,
        remark: undefined,
        socialCode: undefined,
        type: undefined
      }
    }
  },
  created() {

  },
  methods: {
    getAwardData() {
      getAwardList({ socialCode: localStorage.getItem('creditCode') }).then(response => {
        this.listAward = response.rows
        if (this.listAward.length == null || this.listAward.length == 0) {
          this.listAward = [];
          // this.listAward.push(awardForm)
        }
      })
    },
    getInfo() {
      this.year = localStorage.getItem('examineYear')
      getDictByCode('rewardLevel').then(response => {
        this.rewardLevelOptions = response.data
        getDictByCode('reportRecord').then(response => {
          this.rewardLevelOptions.push(...response.data)
        })
      })
      getTableInfoByPage(2).then(response => {
        this.postForm = JSON.parse(JSON.stringify(response.data).replace(/null/g, '""'))
        // if(this.postForm.yearlyAwards != ''){
        //   this.listAwards = JSON.parse(this.postForm.yearlyAwards)
        // }
      })
      this.getAwardData();
    },
    listAwardAdd() {
      this.listAward.push(Object.assign({}, this.awardForm))
    },
    listAwardDelete(index) {
      // if (this.listAwards.length == 1) {
      //   return
      // }
      this.listAward.splice(index, 1)
    },
    saveAward() {
      for (let i = 0; i < this.listAward.length; i++) {
        if (!this.listAward[i].id) {
          this.listAward[i].socialCode = localStorage.getItem('creditCode')
          if (this.listAward[i].title) {
            addAward(this.listAward[i]).then(response => {
              console.log(response.data)
              if (response.code == 200) {
                this.$message({
                  message: '保存获奖表彰成功！',
                  type: 'success'
                })
              }
              this.getAwardData();
            })
          } else {
            this.$message({
              message: '请填写获奖表彰名称！',
              type: 'error'
            })
          }
        }
      }
    },
    postInfo() {
      this.$refs.postFormRef.validate(valid => {
        if (valid) {
          this.postForm.creditCode = localStorage.getItem('creditCode')
          this.postForm.examineYear = localStorage.getItem('examineYear')
          this.postForm.organizationBaseId = '1'
          let dataAward = [];
          for (let i = 0; i < this.listAward.length; i++) {
            dataAward.push({awardName:this.listAward[i].title,awardlevel:this.listAward[i].level,time:this.listAward[i].getTime})
          }
          this.postForm.yearlyAwards = JSON.stringify(dataAward)
          mfSavePractitioners(this.postForm).then(response => {
            this.$message({
              message: '保存从业人员信息成功',
              type: 'success'
            })
            this.getInfo()
          })
        } else {
          this.$message({
            message: '请填写相关内容！',
            type: 'error'
          })
        }
      })
    }
  }
}
</script>
<style scoped lang="scss">
.el-table {
  --el-table-row-hover-bg-color: rgba(39, 137, 238, 0.1);
  --el-table-border-color: #e0e5f0;
}

:deep(.el-card.is-always-shadow) {
  box-shadow: 0 1px 14px 0 rgba(209, 224, 239, 0.6)
}

/* 拉框选中 */
.el-select-dropdown__item {
  height: 24px;
  line-height: 24px;
  font-size: 12px;
}

/* 鼠标经过下拉框 */
.el-select-dropdown__item:hover {
  height: 24px;
  line-height: 24px;
  font-size: 12px;
}

.el-select-dropdown__item.selected {
  color: #2789EE;
}

.custom-label .el-form-item__label {
  color: red;
  /* 改变文本颜色 */
  font-size: 14px;
  /* 改变文本大小 */
  text-align: right;
}

.app-container {
  margin-top: 40px;
  margin-left: 15%;
  width: 70%;
}

.div-bg {
  width: 100%;
  background: #F0F0F0;
  height: 10px;
}

.box-card {
  width: 100%;
  margin-top: 20px;
  padding: 20px;
}

.el-col {
  padding-left: 5px;
}

.divider-title {
  font-weight: bold;
  font-size: 18px;
}

.custom-select .el-select-dropdown {
  max-height: 600px;
  /* 设置为你想要的高度 */
  overflow: auto;
  /* 添加滚动条 */
}

table {
  border-collapse: collapse;
  /* 确保表格的边框合并为单一边框 */
  width: 100%;
  /* 表格宽度 */
  overflow: auto;
}

td {
  border: 1px solid #ababab;
  /* 设置单线边框 */
  padding: 6px;
  /* 单元格内边距 */
}

.el-form-item {
  margin-bottom: 0px;
}

:deep(.el-form-item__label) {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  text-align: right;
  height: 32px;
  line-height: 16px;
}
</style>
